import request from '@/utils/request'

// 获取会员等级列表
export function getMemberLevelList(params) {
  return request({
    url: '/api/member-levels',
    method: 'get',
    params
  })
}

// 创建会员等级
export function createMemberLevel(data) {
  return request({
    url: '/api/member-levels',
    method: 'post',
    data
  })
}

// 更新会员等级
export function updateMemberLevel(id, data) {
  return request({
    url: `/api/member-levels/${id}`,
    method: 'put',
    data
  })
}

// 删除会员等级
export function deleteMemberLevel(id) {
  return request({
    url: `/api/member-levels/${id}`,
    method: 'delete'
  })
}

// 更新会员等级排序
export function updateMemberLevelSort(data) {
  return request({
    url: '/api/member-levels/sort',
    method: 'put',
    data
  })
}

// 获取会员等级详情
export function getMemberLevelDetail(id) {
  return request({
    url: `/api/member-levels/${id}`,
    method: 'get'
  })
}

// 获取会员等级权益列表
export function getMemberLevelBenefits() {
  return request({
    url: '/api/member-levels/benefits',
    method: 'get'
  })
} 